package cn.billy.basic.mapper;

import cn.billy.basic.query.BaseQuery;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

public interface BaseMapper<T> {
    /*
     * @Title: loadAll
     * @Description: 查询全部
     * @Author: Billy
     * @Version: 1.0
     * @Date:  2022/6/21 21:12
     * @Parameters:
     * @Return List
     */
    List<T> loadAll();

    /*
     * @Title: remove
     * @Description: 根据id进行删除
     * @Author: Billy
     * @Version: 1.0
     * @Date:  2022/6/21 21:13
     * @Parameters: id
     * @Return void
     */
    void remove(Long id);

    /*
     * @Title: add
     * @Description: 添加方法
     * @Author: Billy
     * @Version: 1.0
     * @Date:  2022/6/21 21:13
     * @Parameters: department
     * @Return void
     */
    void add(T t);

    /*
     * @Title: update
     * @Description: 修改方法
     * @Author: Billy
     * @Version: 1.0
     * @Date:  2022/6/21 21:14
     * @Parameters: department
     * @Return void
     */
    void update(T t);

    /*
     * @Title: getById
     * @Description: 根据id查询，返回对象
     * @Author: Billy
     * @Version: 1.0
     * @Date:  2022/6/21 21:14
     * @Parameters: id
     * @Return Department
     */
    T getById(Long id);


    /*
     * @Title: queryData
     * @Description: 分页+高级查询
     * @Author: Billy
     * @Version: 1.0
     * @Date:  2022/6/21 21:14
     * @Parameters: departmentQuery
     * @Return List
     */
    List<T> queryData(BaseQuery baseQuery);


    /*
     * @Title: queryCount
     * @Description: 查询总条数
     * @Author: Billy
     * @Version: 1.0
     * @Date:  2022/6/21 21:15
     * @Parameters: departmentQuery
     * @Return Integer
     */
    Integer queryCount(BaseQuery baseQuery);


    void batchDel(Long[] ids);
}
